package com.ilancuo.init;

/**
 * 测试初始化顺序
 * Created by ilancuo on 2018/4/7.
 *
 * 输出结果为:
 * STATIC
 * 20
 * 0
 */
public class InitTest {

    public static int age;

    public static void main(String[] args) {
        Test test = new Test();
    }

    static {
        age = 10;
        System.out.println("STATIC");
    }

    static {
        age = 20;
    }

    static {
        System.out.println(age);
    }
}

class Test {
    public int x;

    public Test() {
        System.out.println(x);
    }
}
